package jee.boot.module.iexp.rest;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jee.boot.common.basic.CrudController;
import jee.boot.common.basic.result.ResponseMessage;
import jee.boot.common.basic.result.Result;
import jee.boot.entity.task.IexpTask;
import jee.boot.module.iexp.service.IexpTaskService;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 导入导出任务Controller
 */
@Api(tags = "导入导出任务")
@RestController
@RequestMapping(value = "/iexp/task")
public class IexpTaskRestController extends CrudController<IexpTaskService, IexpTask> {
    /**
     * 重新执行
     *
     * @param entity
     * @return
     */
    @PostMapping("/reExecute")
    @ApiOperation(value = "重新执行")
    public ResponseMessage<IexpTask> reExecute(@RequestBody IexpTask entity) {
        service.reExecute(entity);
        return Result.success();
    }
//
//    /**
//     * 下载文件
//     *
//     * @param entity
//     * @return
//     */
//    @GetMapping("/download")
//    @ApiOperation(value = "下载文件")
//    public ResponseMessage<IexpTask> download(IexpTask entity, HttpServletRequest request, HttpServletResponse response) {
//        service.download(entity, request, response);
//        return null;
//    }
}
